package com.itheima.Controller;

import com.itheima.Service.SetmealService;
import com.itheima.common.constant.MessageConstant;
import com.itheima.common.entity.Result;
import com.itheima.pojo.Setmeal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
//体检套餐
@RestController
@RequestMapping("setmeal")
public class MobileSetmealController {
    @Autowired
    private SetmealService setmealService;
    //获取所有套餐信息
    @PostMapping("/getSetmeal")
    public Result getSetmeal(){
        List<Setmeal> list = setmealService.findAll();
        return new Result(true, MessageConstant.QUERY_SETMEAL_SUCCESS,list);
    }
            //根据套餐id查询套餐详情
    @PostMapping("/findById")
    public Result findById(Integer id){
        Setmeal setmeal = setmealService.findById(id);
        return new Result(true, MessageConstant.QUERY_SETMEAL_SUCCESS,setmeal);
    }
    
    
}
